#ifndef __RED_BLOCK_OBJECT_H__
#define __RED_BLOCK_OBJECT_H__

#include "rarray.h"
#include "redobject.h"

typedef struct _RedBlockEntry
{
	int			 e_pc;
	RedObject	*e_name;
	rarray_t	 e_types;
} RedBlockEntry;

typedef struct _RedBlockObject
{
	RedObject_HEAD

	int			 b_finally;
	int			 b_generic;
	rarray_t	 b_entries;
} RedBlockObject;

RED_EXPORT extern RedTypeObject RedType_Block;

#define RedBlock_Exact(o)		((o)->ob_type == &RedType_Block)
#define RedBlock_Finally(o)		(((RedBlockObject *)(o))->b_finally)
#define RedBlock_Generic(o)		(((RedBlockObject *)(o))->b_generic)
#define RedBlock_Entries(o)		(&(((RedBlockObject *)(o))->b_entries))

RED_EXPORT RedObject *RedBlock_Create(void);
RED_EXPORT RedBlockEntry *RedBlock_Append(RedObject *self);

#endif /* __RED_BLOCK_OBJECT_H__ */
